#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFileDialog>
#include <QString>
#include <QVector>


#include "database.h"
#include "productdialog.h"
#include "subproductdialog.h"
#include "suppliersdialog.h"
#include "settabu.h"

#include "workerthread.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void loadBase(DataBase *newBase);
    void setProcessBase();

private slots:
    void openDatabase();
    void saveDatabase();
    void editProduct();
    void editSubProducts();
    void editSuppliers();
    void editTabu();


    void on_START_clicked();
    void on_algStep(int number,  QVector<float> values,QVector<int> bestSolution);
    void on_saveTabu(int iter, int  iterImprov,int  improv,int  tabuLength,
                     int  iterJump,int  iterLocalJump,int  kara,int  nagroda);

signals:
    void tabuParam(int iter, int  iterImprov,int  improv,int  tabuLength,
                   int  iterJump,int  iterLocalJump,int  kara,int  nagroda) ;



private:
    Ui::MainWindow *ui;
    DataBase *ourBase;
    DataBase *processBase;
    QStandardItemModel *suppliersModel;
    QStandardItemModel *subProductModel;
    QStandardItemModel *solutionModel;
    workerThread *algTabu;
    //wejsciowe do tabu
public:
    int _iter;
    int _iterImprov;
    int _improv;
    int _tabuLength;
    int _iterJump;
    int _iterLocalJump;
    QVector<int> _firstSolution;
    int _kara;
    int _nagroda;
};

#endif // MAINWINDOW_H
